<?php

namespace app\api\controller\jd;

use app\api\service\jd\UserService;
use think\facade\Request;

class User
{
    protected $Service;
    public function __construct()
    {
        $this->Service = UserService::getInstance();
    }

    //获取用户的cookie
    public function getCookie(){
        $params = Request::get();
        $result = $this->Service->getCookie($params);
        return writeJson(200,$result);
    }

    //获取用户视频信息
    public function getInfo(){
        $result = $this->Service->getInfo();
        return writeJson(200,$result,'获取信息成功');
    }

    //获取审核通过的视频链接
    public function getVideoList(){
        $video = $this->Service->getVideoList();
        return writeJson(200,$video,'获取成功');

    }

    //变成本地视频做个状态更改
    public function updateVideoList(){
        $params = Request::get();
        $this->Service->updateVideoList($params);
        return writeJson(200,'','更新成功');
    }

    //用户分发
    public function distribute(){
        $params = Request::post();
        $this->Service->distribute($params);
        return writeJson(200,$params["reason"]);
    }



}
